<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:a="http://richfaces.org/a4j" template="/layout/template.xhtml">

	<ui:define name="body">

		<h:form id="courseAddStudent">

			<rich:panel>
				<h:panelGrid columns="1" width="%100">
					<a:outputPanel id="req">
						
						<s:decorate id="announcementField1" template="/layout/edit.xhtml">
							<ui:define name="label">#{messages['txt.name']}</ui:define>
							<h:inputText value="#{lectureNoteHome.instance.name}"
								required="true" />
						</s:decorate>
						<s:decorate id="announcementField2" template="/layout/edit.xhtml" rendered="#{lectureNoteHome.instance.fileName==null}">
							<ui:define name="label">#{messages['txt.fileToBeUploaded']}</ui:define>
							<rich:fileUpload fileUploadListener="#{lectureNoteHome.listener}"
								maxFilesQuantity="1" id="upload" immediateUpload="true"
								allowFlash="false" autoclear="false" ajaxSingle="true"
								listHeight="55" required="true" >
								<a:support event="onuploadcomplete" reRender="req"
									ajaxSingle="true" />
							</rich:fileUpload>
						</s:decorate>
						<s:decorate id="announcementField3" template="/layout/display.xhtml" rendered="#{lectureNoteHome.instance.fileName!=null}">
							<ui:define name="label">#{messages['txt.uploadedFile']}</ui:define>
							<h:outputText value="#{lectureNoteHome.instance.fileName}"/>
						</s:decorate>
						<a:commandButton value="#{messages['txt.UploadNewFile']}" action="#{lectureNoteHome.clearFileData}" reRender="req" rendered="#{lectureNoteHome.instance.fileName!=null}"></a:commandButton>
					</a:outputPanel>

				</h:panelGrid>
			</rich:panel>


			<div class="actionButtons">
				<h:commandButton id="save" value="Save"
					action="#{lectureNoteHome.persistWithCourse}"
					rendered="#{!lectureNoteHome.managed}">
				</h:commandButton>
				<h:commandButton id="update" value="Save"
					action="#{lectureNoteHome.update}"
					rendered="#{lectureNoteHome.managed}">
					<f:param name="courseId" value="#{courseHome.courseId}" />
				</h:commandButton>
				<h:commandButton id="delete" value="Delete"
					action="#{lectureNoteHome.remove}" immediate="true"
					rendered="#{lectureNoteHome.managed}">
				</h:commandButton>
				<s:button id="cancel" value="#{messages.Cancel}"
					view="/Course/course.xhtml" propagation="end">
				</s:button>
			</div>

		</h:form>

	</ui:define>

</ui:composition>
